package com.caopeng.javaee.service.ServiceImpl;

import com.caopeng.javaee.dao.StudentJpa;
import com.caopeng.javaee.dao.TeacherJpa;
import com.caopeng.javaee.entity.student;
import com.caopeng.javaee.entity.teacher;
import com.caopeng.javaee.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: javaee
 * @description: 接口实现
 * @author: caopeng
 * @create: 2018-12-06 12:22
 **/
@Service
public class LoginServiceImpl implements LoginService {
    @Autowired
    private TeacherJpa teacherjpa;
    @Autowired
    private StudentJpa studentjpa;
    @Override
    public List<teacher> TfindByAccountAndPassword(String account, String password) {
        return teacherjpa.findByAccountAndPassword(account,password);
    }

    @Override
    public student SfindByAccountAndPassword(String account, String password) {
        return studentjpa.findByAccountAndPassword(account,password);
    }

    @Override
    public teacher TfindByAccountAndPhone(String account, String phone) {
        return teacherjpa.findByAccountAndPhone(account,phone);
    }

    @Override
    public student SfindByAccountAndPhone(String account, String phone) {
        return studentjpa.findByAccountAndPhone(account,phone);
    }
}

